home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / test1.bas (.txt) < prev    next >
Encoding:
GW-BASIC  |  1984-04-24  |  1.8 KB  |  47 lines

  1. 10  'FILE NAMED TEST1.BAS  WHAT IS THE REAL FILE CHARACTERISTICS..?????
  2. 15  'CONTRIBUTED BY RICH SCHINNELL.
  3. 20  CLS:CLOSE:KEY OFF
  4. 30  DEFINT A-Z:FALSE=0:TRUE=NOT FALSE
  5. 40  ON ERROR GOTO 370
  6. 42  PRINT "THIS PROGRAM WILL READ A FILE WHICH YOU SUSPECT MIGHT HAVE
  7. 43  PRINT "GARBAGE IN IT, ie Tabs or NULLs or something like that.
  8. 44  PRINT "It will print you the ascii/hex and the real ascii equivalents of
  9. 45  PRINT "what is in your file. a  Q will end once you have
  10. 46  PRINT "started the program. Ctrl+PrtSc to print on printer ":PRINT
  11. 50  INPUT "What is the name of your file you want to check? ";INRICH$
  12. 60  D$="         1         2         3         4         5         6         7"
  13. 70  C$="1234567890123456789012345678901234567890123456789012345678901234567890123456789"
  14. 80  IF LEN(INRICH$)<1 THEN 400
  15. 90  OPEN INRICH$ FOR INPUT AS #1
  16. 100  LINE INPUT #1,A$:F$="":G$="":H$="":J$="":K$="":INRICH$=LEFT$(INRICH$,80)
  17. 110  CLS:CNT=CNT+1
  18. 120  LOCATE 25,1:PRINT "Press Q to Stop, any other Key to continue":LOCATE 1,1
  19. 130  PRINT "Actual printing positions for the first 79 characters of line";CNT
  20. 140  PRINT:PRINT D$:PRINT C$
  21. 150  COLOR 0,7:PRINT A$:COLOR 7,0
  22. 160  PRINT "ASCII equivalents for each character":PRINT
  23. 170  FOR I=1 TO LEN(A$)
  24. 180  E$=STR$(ASC(MID$(A$,I,1)))
  25. 190  W$=HEX$(ASC(MID$(A$,I,1))):IF LEN(W$)<2 THEN W$="0"+W$
  26. 200  J$=J$+LEFT$(W$,1):K$=K$+RIGHT$(W$,1)
  27. 210  IF LEN(E$)>3 THEN F$=F$+MID$(E$,2,1) ELSE F$=F$+"0"
  28. 220  IF LEN(E$)>3 THEN G$=G$+MID$(E$,3,1) ELSE G$=G$+MID$(E$,2,1)
  29. 230  H$=H$+RIGHT$(E$,1)
  30. 240  NEXT I
  31. 250  COLOR 0,7:PRINT F$:PRINT G$:PRINT H$:COLOR 7,0
  32. 260  PRINT:PRINT" The HEXADECIMAL Values of your characters are:"
  33. 270  COLOR 0,7:PRINT J$:PRINT K$:COLOR 7,0
  34. 280  PRINT:PRINT "length of your line is";LEN(A$):PRINT "this is what is actually in your file":COLOR 0,7
  35. 290  FOR I=1 TO LEN(H$)
  36. 300  J$=MID$(F$,I,1)+MID$(G$,I,1)+MID$(H$,I,1)
  37. 310  PRINT CHR$(VAL(J$));
  38. 320  NEXT I:COLOR 7,0
  39. 330  PRINT:PRINT:BEEP
  40. 340  B$=INKEY$:IF B$="" THEN 340
  41. 350  IF B$="Q" OR B$="q" THEN CLOSE:CLS:KEY ON:END
  42. 360  GOTO 100
  43. 370  ' error trapping
  44. 380  IF ERL=90 THEN PRINT "bumb file name":RESUME 50
  45. 390  PRINT "error #";ERR;" has occured in line ";ERL
  46. 400  KEY ON:CLOSE:END
  47.